<script>
	// <!--
	/* function */
	skrg_pq = false;
	
	function hapus_entry(id){
		$.ajax({
			url : "c_entry",
			data : {jadwal_id : id, task : 'DELETE'},
			type : 'POST'
		}).done(function(response){
			gridJadwal.trigger('reloadGrid');
		});
	}
	
	function strtoupper (str) {
	  return (str + '').toUpperCase();
	}


	function edit_entry(id){
		$.ajax({
			url : "c_entry",
			data : {jadwal_id : id, task : 'LIST_JADWAL', option : 'single'},
			type : 'POST',
			dataType : 'JSON'
		}).done(function(response){
			hiddenJadwalid.val(response[0].jadwal_id);
			cmbCabang.val(response[0].m_cabang_id);
			cmbOwner.val(response[0].m_owner_id);
			cmbOwner.trigger("chosen:updated");
			cmbKondisi.val(response[0].m_kondisi_id);
			txtKoordinator.val(response[0].jadwal_koordinator);
			txtNamaproyek.val(response[0].jadwal_namaproyek);
			txtNamaproyekalias.val(response[0].jadwal_alias);
			txtNk.val(response[0].jadwal_nk);
			// txtNk.attr("readonly","readonly");
			txtPagu.val(response[0].jadwal_pagu);
			txtremark.val(response[0].jadwal_remkontrak);
			txtUpdatestatus.val(response[0].jadwal_updatestatus);
			txtDoc.val(response[0].jadwal_nodoc);
			if (response[0].jadwal_tglcr != '1970-01-01' && response[0].jadwal_tglcr != null && response[0].jadwal_tglcr != '0000-00-00')
				dateCr.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglcr) ))  ;
				else
				dateCr.val("")  ;
			if(response[0].jadwal_flagcr == "Y") checkCr.attr('checked', true); 
				else checkCr.attr('checked', false);
			if(response[0].jadwal_flagmr == "Y") checkMr.attr('checked', true);
				else checkMr.attr('checked', false);
			if(response[0].jadwal_flagijin == "Y") checkIjin.attr('checked', true);
				else checkIjin.attr('checked', false);
			if(response[0].jadwal_flagundangan == "Y") checkUndangan.attr('checked', true);
				else checkUndangan.attr('checked', false);
			if(response[0].jadwal_flagllg == "Y") checkLlg.attr('checked', true);
				else checkLlg.attr('checked', false);
			if(response[0].jadwal_flagboq == "Y") checkBoq.attr('checked', true);
				else checkBoq.attr('checked', false);
			if(response[0].jadwal_flaqrks == "Y") checkRks.attr('checked', true);
				else checkRks.attr('checked', false);
			if(response[0].jadwal_flaggbr == "Y") checkGbr.attr('checked', true);
				else checkGbr.attr('checked', false);
			if(response[0].jadwal_nolapor == "Y") checkNolapor.attr('checked', true);
				else checkNolapor.attr('checked', false);
				
			if (response[0].jadwal_tglaan != '1970-01-01' && response[0].jadwal_tglaan != null && response[0].jadwal_tglaan != '0000-00-00')
				dateAanwijz.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglaan) ) ) ;
				else
				dateAanwijz.val("")  ;
			if (response[0].jadwal_tglpq != '1970-01-01' && response[0].jadwal_tglpq != null && response[0].jadwal_tglpq != '0000-00-00')
				datePq.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglpq) ) ) ;
				else
				datePq.val("")  ;
			if (response[0].jadwal_tglpemasukan != '1970-01-01' && response[0].jadwal_tglpemasukan != null && response[0].jadwal_tglpemasukan != '0000-00-00')
				datePemasukan.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglpemasukan) ) ) ;
				else
				datePemasukan.val("")  ;
			if (response[0].jadwal_tglpemasukan2 != '1970-01-01' && response[0].jadwal_tglpemasukan2 != null && response[0].jadwal_tglpemasukan2 != '0000-00-00')
				datePemasukan2.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglpemasukan2) ) ) ;
				else
				datePemasukan2.val("")  ;
			if (response[0].jadwal_tglkontrak != '1970-01-01' && response[0].jadwal_tglkontrak != null && response[0].jadwal_tglkontrak != '0000-00-00')
				dateKontrak.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglkontrak) ) ) ;
				else
				dateKontrak.val("")  ;
			if (response[0].jadwal_tglklarifikasi != '1970-01-01' && response[0].jadwal_tglklarifikasi != null && response[0].jadwal_tglklarifikasi != '0000-00-00')
				dateKlarifikasi.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_tglklarifikasi))  ) ;
				else
				dateKlarifikasi.val("")  ;
			if (response[0].jadwal_prabrain != '1970-01-01' && response[0].jadwal_prabrain != null && response[0].jadwal_prabrain != '0000-00-00')
				datePrabrain.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_prabrain) ) ) ;
				else
				datePrabrain.val("")  ;
			if (response[0].jadwal_brain1 != '1970-01-01' && response[0].jadwal_brain1 != null && response[0].jadwal_brain1 != '0000-00-00')
				dateBrain1.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_brain1) ))  ;
				else
				dateBrain1.val("")  ;
			if (response[0].jadwal_brain2 != '1970-01-01' && response[0].jadwal_brain2 != null && response[0].jadwal_brain2 != '0000-00-00')
				dateBrain2.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_brain2) ))  ;
				else
				dateBrain2.val("")  ;
			if (response[0].jadwal_finalisasi != '1970-01-01' && response[0].jadwal_finalisasi != null && response[0].jadwal_finalisasi != '0000-00-00')
				dateFinal.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_finalisasi))  ) ;
				else
				dateFinal.val("")  ;
			if (response[0].jadwal_cekdok != '1970-01-01' && response[0].jadwal_cekdok != null && response[0].jadwal_cekdok != '0000-00-00')
				dateCekdoc.datepicker( "setDate" , new Date(Date.parse(response[0].jadwal_cekdok) ) ) ;
				else
				dateCekdoc.val("")  ;
		
			cmbAnggaran.val(response[0].jadwal_picanggaran);
			cmbMetode.val(response[0].jadwal_picmetode);
			cmbMe.val(response[0].jadwal_picme);
			cmbHarga.val(response[0].jadwal_picharga);
			cmbVolume.val(response[0].jadwal_picvolume);
			cmbExpert.val(response[0].jadwal_picexpert);
			txtLokasidoc.val(response[0].jadwal_lokasi);
			if (cmbKondisi.find('option:selected').text() == "PASCA" || cmbKondisi.find('option:selected').text() == "SELESAI"){
				divKhususpasca.slideDown("slow");
				cmbStatus.val(response[0].jadwal_status);
				cmbKondisi.find('option:contains(PQ)').hide();
				cmbKondisi.find('option:contains(EE)').hide();
			}else{
				divKhususpasca.slideUp("slow");
				cmbStatus.val("");
				cmbKondisi.find('option:contains(PQ)').show();
				cmbKondisi.find('option:contains(EE)').show();
			}
			
			if (cmbKondisi.find('option:selected').text() == "PQ"){
				divPq.slideDown("slow");
				divAanwijz.slideUp("slow");
				divPemasukan.slideUp("slow");
				divPemasukan2.slideUp("slow");
				divKlarifikasi.slideUp("slow");
				divKontrak.slideUp("slow");
				skrg_pq = true;
			}else{
				divPq.slideUp("slow");		
				divAanwijz.slideDown("slow");
				divPemasukan.slideDown("slow");
				divPemasukan2.slideDown("slow");
				divKlarifikasi.slideDown("slow");
				divKontrak.slideDown("slow");
				skrg_pq = false;
			}
			
			if (cmbKondisi.find('option:selected').text() == "SELESAI"){
				divStatus.slideDown("slow");
				divNolapor.slideDown("slow");
			}else{
				divStatus.slideUp("slow");
				divNolapor.slideUp("slow");
			}
			btnRevisi.show("slow");
			
			$(".currency").formatCurrency();
		});
	}
	
	$(function(){
		/* external function */
			
			$.fn.getCombobox = function(data, key, label, desc = ""){
				var field = $(this);
				field.html("<option></option>");
				$.ajax({
					url : "c_entry",
					data : data,
					type : 'POST', dataType : 'json'
				}).done(function(response){
					for(i=0;i<response.length;i++){
						var option = "<option value='"+response[i][key]+"' ";
						if (desc != "")
							option += " alt='<div class=desc>"+response[i][desc]+"</div>'";
							
						option += " >"+response[i][label]+"</option>";
						field.append(option);
					}
						field.chosen({width: "95%"});
						field.trigger("chosen:updated");
				});
			}
			
		$.fn.serializeObject = function()
		{
		   var o = {};
		   var a = this.serializeArray();
		   $.each(a, function() {
			   if (o[this.name]) {
				   if (!o[this.name].push) {
					   o[this.name] = [o[this.name]];
				   }
				   o[this.name].push(this.value || '');
			   } else {
				   o[this.name] = this.value || '';
			   }
		   });
		   return o;
		};
		btnRevisi = $(".btnrevisi");
		hiddenJadwalid = $("#hidden-jadwalid");
		cmbCabang = $("#cmb-cabang");
		cmbOwner = $("#cmb-owner");
		cmbKondisi = $("#cmb-kondisi");
		cmbMatauang = $("#cmb-matauang");
		cmbStatus = $("#cmb-status");
		txtKoordinator = $("#txt-koordinator");
		txtNamaproyek = $("#txt-namaproyek");
		txtNamaproyekalias = $("#txt-namaproyekalias");
		txtNk = $("#txt-nk");
		txtPagu = $("#txt-pagu");
		txtremark = $("#txt-remark");
		txtUpdatestatus = $("#txt-updatestatus");
		dateCr = $("#date-cr");
		checkCr = $("#check-cr");
		checkMr = $("#check-mr");
		checkIjin = $("#check-ijin");
		checkUndangan = $("#check-undangan");
		checkLlg = $("#check-llg");
		checkBoq = $("#check-boq");
		checkRks = $("#check-rks");
		checkGbr = $("#check-gbr");
		checkNolapor = $("#check-nolapor");

		dateAanwijz = $("#date-aanwijz");
		datePq = $("#date-pq");
		datePemasukan = $("#date-pemasukan");
		datePemasukan2 = $("#date-pemasukan2");
		dateKlarifikasi = $("#date-klarifikasi");
		dateKontrak = $("#date-kontrak");
		btnSimpan = $("#btn-simpan");
		btnReset = $("#btn-reset");
		formEntry = $("#form-entry");
		gridJadwal = $("#grid-jadwal");
		
		datePrabrain = $("#date-prabrain");
		dateBrain1 = $("#date-brain1");
		dateBrain2 = $("#date-brain2");
		dateFinal = $("#date-final");
		dateCekdoc = $("#date-cekdok");
		
		cmbAnggaran = $("#cmb-anggaran");
		cmbMetode = $("#cmb-metode");
		cmbMe = $("#cmb-me");
		cmbHarga = $("#cmb-harga");
		cmbVolume = $("#cmb-volume");
		cmbExpert = $("#cmb-expert");
		
		divKhususpasca = $("#div-khususpasca");
		divPq = $("#div-pq");
		divAanwijz = $("#div-aanwijz");
		divPemasukan = $("#div-pemasukan");
		divPemasukan2 = $("#div-pemasukan2");
		divKlarifikasi = $("#div-klarifikasi");
		divKontrak = $("#div-kontrak");
		divStatus = $("#div-status");
		divLokasidoc = $("#div-lokasidoc");
		divNolapor = $("#div-nolapor");
		
		formRevisi = $("#form-revisi");
		dateRevisitgl = $("#date-revisitgl");
		txtRevisiharga = $("#txt-revisiharga");
		txtRevisiketerangan = $("#txt-revisiketerangan");
		hiddenRevisiId = $("#revisiid");
		btnSimpanrevisi = $("#btn-simpanrevisi");
		btnResetrevisi= $("#btn-resetrevisi");
		
		formHistory = $("#form-history");
		dateHistorytgl = $("#date-historytgl");
		txtHistoryketerangan = $("#txt-historyketerangan");
		hiddenHistoryId = $("#historyid");
		btnSimpanHistory = $("#btn-simpanhistory");
		btnResetHistory= $("#btn-resethistory");
		historyjenis = $("#historyjenis");
		
		btnRevisiPq = $("#btn-revisi-pq");
		btnRevisiPemasukan = $("#btn-revisi-pemasukan");
		btnRevisiPemasukan2 = $("#btn-revisi-pemasukan2");
		btnRevisiKlarifikasi = $("#btn-revisi-klarifikasi");
		btnRevisiAanwijz = $("#btn-revisi-aanwijz");
		
		txtLokasidoc = $("#txt-lokasidoc");
		txtDoc = $("#txt-doc");
		
		cmbtipegrid = $("#cmb-tipe-grid");
		pqtopasca = $("#pqtopasca");
		
		/* method started */
		divKhususpasca.slideUp();
		divPq.slideUp();
		divStatus.slideUp();
		divLokasidoc.slideUp();
		divNolapor.slideUp();
		btnRevisi.hide();
		
		/* make component */
		cmbOwner.getCombobox({ task : "owner"},"owner_id","owner_nama");
		dateCr.datepicker({dateFormat : 'dd-mm-yy'});
		dateAanwijz.datepicker({dateFormat : 'dd-mm-yy'});
		datePq.datepicker({dateFormat : 'dd-mm-yy'});
		datePemasukan.datepicker({dateFormat : 'dd-mm-yy'});
		datePemasukan2.datepicker({dateFormat : 'dd-mm-yy'});
		dateKontrak.datepicker({dateFormat : 'dd-mm-yy'});
		dateKlarifikasi.datepicker({dateFormat : 'dd-mm-yy'});
		datePrabrain.datepicker({dateFormat : 'dd-mm-yy'});
		dateBrain1.datepicker({dateFormat : 'dd-mm-yy'});
		dateBrain2.datepicker({dateFormat : 'dd-mm-yy'});
		dateFinal.datepicker({dateFormat : 'dd-mm-yy'});
		dateCekdoc.datepicker({dateFormat : 'dd-mm-yy'});
		dateRevisitgl.datepicker({dateFormat : 'dd-mm-yy'});
		dateHistorytgl.datepicker({dateFormat : 'dd-mm-yy'});
		
		gridJadwal.jqGrid({
			ajaxGridOptions : {type:"POST"},
			serializeGridData : function(postdata) {return postdata; },
			url:'c_entry',
			postData : {
				task :  'LIST_JADWAL'
			},
			datatype: "json",
			colNames:['Nama Proyek','Tgl Aanwijz','Tgl Pemasukan','Tgl Klarifikasi','Tgl Kontrak','','Action'],
			colModel:[ 
				{name:'jadwal_namaproyek',index:'jadwal_namaproyek', width : 350, search : true},
				{name:'jadwal_tglaan',index:'jadwal_tglaan',align:'center',formatter:'dateInd', width : 90, search : false},
				{name:'jadwal_tglpemasukan',index:'jadwal_tglpemasukan',align:'center',formatter:'dateInd', width : 90, search : false},
				{name:'jadwal_tglklarifikasi',index:'jadwal_tglklarifikasi',align:'center',formatter:'dateInd', width : 90, search : false},
				{name:'jadwal_tglkontrak',index:'jadwal_tglkontrak',align:'center',formatter:'dateInd', width : 90, search : false},
				{name:'jadwal_flag',index:'jadwal_flag', width : 20, search : false},
				{name:'action',index:'action', width : 90, search : false}
			],shrinkToFit : true,
			autoWidth : true,
			autoHeight : true,
			height : '100%',
			rowNum:10,
			width:'100%',
			rowList:[10,20,30],
			pager: '#pgrid-jadwal',
			viewrecords: true,
			sortorder: "desc",
			caption:"Jadwal Proyek"
		}); 
		gridJadwal.jqGrid('filterToolbar',{});
		
		/* event */
		btnSimpan.click(function(){
			data = formEntry.serializeObject();
			$.ajax({
				url : "c_entry",
				data : data,
				type : 'POST'
			}).done(function(response){
				gridJadwal.trigger('reloadGrid');
				btnReset.click();
			});
		});
		
		btnReset.click(function(){
			btnRevisi.hide("slow");
			// txtNk.removeAttr("readonly");
			cmbKondisi.find('option:contains(PQ)').show();
			cmbKondisi.find('option:contains(EE)').show();
		});
		
		btnRevisi.click(function(){
			var data = $(this).data();
			if( data.revisi == 0){
				btnResetrevisi.click();
				var jadwal_id = hiddenJadwalid.val();
				$.ajax({
					url : 'c_entry',
					data : {
						task : 'LASTREVISI',
						jadwal_id : jadwal_id
					},
					dataType : 'JSON',
					type : 'POST'
				}).done(function(response){
					
					hiddenRevisiId.val(jadwal_id);
					dateRevisitgl.val(response.revisi_tgl);
					txtRevisiharga.val(response.revisi_harga);
					txtRevisiketerangan.val(response.revisi_keterangan);
				});
			}else{
				var jadwal_id = hiddenJadwalid.val();
				hiddenHistoryId.val(jadwal_id);
				historyjenis.val(data.revisi);
			}
		});
		
		btnSimpanrevisi.click(function(){
			data = formRevisi.serializeObject();
			$.ajax({
				url : "c_entry",
				data : data,
				type : 'POST'
			});
		});
		
		
		btnSimpanHistory.click(function(){
			data = formHistory.serializeObject();
			$.ajax({
				url : "c_entry",
				data : data,
				type : 'POST',
				dataType : 'JSON'
			}).done(function(response){
				if (response.status == "success"){
					
			dateAanwijz
			console.log(response.tgl);
					switch (data.historyjenis){
						case "1" : datePemasukan.datepicker( "setDate" , new Date(Date.parse(response.tgl) ) ); break; 
						case "2" : datePemasukan2.datepicker( "setDate" , new Date(Date.parse(response.tgl) ) ); break; 
						case "3" : datePq.datepicker( "setDate" , new Date(Date.parse(response.tgl) ) ); break; 
						case "4" : dateAanwijz.datepicker( "setDate" , new Date(Date.parse(response.tgl) ) ); break; 
						case "5" : dateKlarifikasi.datepicker( "setDate" , new Date(Date.parse(response.tgl) )); break; 
						default : console.log(data.historyjenis);
					}
				}
			});
		});
		
		btnResetrevisi.click(function(){
			$("#btn-HiddenResetRevisi").click();
		});
		btnResetHistory.click(function(){
			$("#btn-HiddenResethistory").click();
		});
		cmbKondisi.click(function(){
			pqtopasca.val("false");
			if (cmbKondisi.find('option:selected').text() == "PASCA"){
				if (skrg_pq)
					pqtopasca.val("true");
				divKhususpasca.slideDown("slow");
			}else{
				divKhususpasca.slideUp("slow");
			}
			
			if (cmbKondisi.find('option:selected').text() == "PQ"){
				divPq.slideDown("slow");
				divAanwijz.slideUp("slow");
				divPemasukan.slideUp("slow");
				divPemasukan2.slideUp("slow");
				divKlarifikasi.slideUp("slow");
				divKontrak.slideUp("slow");
			}else{
				divPq.slideUp("slow");		
				divAanwijz.slideDown("slow");
				divPemasukan.slideDown("slow");
				divPemasukan2.slideDown("slow");
				divKlarifikasi.slideDown("slow");
				divKontrak.slideDown("slow");
			}
			
			if (cmbKondisi.find('option:selected').text() == "SELESAI"){
				divStatus.slideDown("slow");
				divNolapor.slideDown("slow");
			}else{
				cmbStatus.val("");
				divStatus.slideUp("slow");
			}
			
			
		});
		
		cmbStatus.click(function(){
			if (cmbStatus.find('option:selected').text() == "Menang"){
				divLokasidoc.slideDown("slow");
			}else{
				divLokasidoc.slideUp("slow");
				divLokasidoc.val("");
			}
		});
		
		txtNamaproyekalias.keyup(function(){
			value = txtNamaproyekalias.val();
			txtNamaproyekalias.val(strtoupper(value));
		});
		
		cmbtipegrid.change(function(){
			tipe = $(this).val();
			gridJadwal.setGridParam({ postData : {task :  'LIST_JADWAL', tipe : tipe}});
			gridJadwal.trigger("reloadGrid");
		});
		
		$(".currency").keydown(function(e){
			keyCode = e.keyCode;
			if ((keyCode < 48 || keyCode  > 57) && keyCode != 8 && keyCode != 46){
				return false;
			}
		});
		
		$(".currency").keyup(function(e){
			$(this).formatCurrency();
		});
		
	});
	// -->
</script>
<style>
/* css urgent */
.form-horizontal .control-group {
	margin-bottom : 5px !important;
}
.currency{
	text-align : right;
}

</style>
<form class="form-horizontal" id="form-entry" disabled=true>
<input type="text" name="hidden-jadwalid" id="hidden-jadwalid" class="hidden" >
<input type="text" name="pqtopasca" id="pqtopasca" placeholder="0" class="hidden">
<input type="text" name="task" value="SAVE" class="hidden">

			<div class="control-group row-fluid">
				<label class="control-label" for="cabang">Cabang</label>
				<div class="controls">
					<?php echo form_dropdown("cmb-cabang",$data_cabang,"","id=cmb-cabang class=span9"); ?>
				</div>
			</div>

			<div class="control-group row-fluid">
				<label class="control-label" for="koordinator">Koordinator</label>
				<div class="controls">
					<input class="span9" type="text" name="txt-koordinator" id="txt-koordinator" placeholder="">
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="namaproyek">Nama Proyek</label>
				<div class="controls">
					<textarea class="span9" name="txt-namaproyek" id="txt-namaproyek" placeholder=""></textarea>
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="namaproyekalias">Nama Alias</label>
				<div class="controls">
					<input  class="span9" type="text" name="txt-namaproyekalias" id="txt-namaproyekalias" placeholder="">
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="owner">Owner</label>
				<div class="controls">
					<div style="width:300px"><select name="cmb-owner" id="cmb-owner" class=span9  ></select></div>
					<?php // echo form_dropdown("cmb-owner",$data_owner,"","id=cmb-owner class=span9"); ?>
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="doc">No Dokumen</label>
				<div class="controls">
					<input  class="span9" type="text" name="txt-doc" id="txt-doc" placeholder="">
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="kondisi">Kondisi</label>
				<div class="controls">
					<?php echo form_dropdown("cmb-kondisi",$data_kondisi,"","id=cmb-kondisi class=span9"); ?>
				</div>
			</div>
			
			<div class="control-group row-fluid"  id="div-status">
				<label class="control-label" for="status">Status</label>
				<div class="controls">
					<?php echo form_dropdown("cmb-status",array("-"=>"","Menang"=>"Menang", "Kalah Harga dll"=>"Kalah Harga dll", "Kalah HP"=>"Kalah HP"),"","id=cmb-status class=span9"); ?>
				</div>
			</div>
			
			<div class="control-group row-fluid"  id="div-nolapor">
				<label class="control-label" for="hijau">Tidak dilaporkan</label>
				<div class="controls"  >
					
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-nolapor" id="check-nolapor">Ya
					</label>
				</div>
			</div>
					
			<div class="control-group row-fluid" id="div-lokasidoc">
				<label class="control-label" for="lokasidoc">Lokasi Dokumen</label>
				<div class="controls">
					<input  class="span9" type="text" name="txt-lokasidoc" id="txt-lokasidoc" placeholder="">
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="nk">Nilai Kontrak</label>
				<div class="controls">

				<div class="input-append">
					<?php $data_matauang = array("IDR","USD"); echo form_dropdown("cmb-matauang",$data_matauang,"","id=cmb-matauang class='span5'"); ?>
					<input class="span9 currency" type="text" name="txt-nk" id="txt-nk" placeholder="0" class="span9">
					<input type="button" value="Revisi" id="btn-revisi" class="btn btnrevisi" data-revisi="0" data-toggle="modal" data-target="#myModal" hidden=true>
				</div>
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="nk">Nilai Pagu</label>
				<div class="controls">

				<div class="input-append">
					<input class="span12 currency" type="text" name="txt-pagu" id="txt-pagu" placeholder="0" class="span12">
				</div>
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="hijau">Contract Review</label>
				<div class="controls"  >
				
						<input type="text" name="date-cr" id="date-cr" class="input input-medium" style="position:relative;top:25px;left: 50px;">
						<label class="checkbox">CR
								<input type="checkbox" value="Y" name="check-cr" id="check-cr">
						</label>
					
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-mr" id="check-mr">MR
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-ijin" id="check-ijin">IJIN < 50 M
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-undangan" id="check-undangan">UNDANGAN
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-llg" id="check-llg">DOC LLG
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-boq" id="check-boq">BOQ
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-rks" id="check-rks">RKS
					</label>
					<label class="checkbox">
						<input type="checkbox" value="Y" name="check-gbr" id="check-gbr">GBR
					</label>
				</div>
				
			</div>
			
			<div class="control-group row-fluid" id="div-pq">
				<label class="control-label" for="pq">PQ</label>
				<div class="controls">
					<div class="input-append">
						<input type="text" name="date-pq" id="date-pq">
						<input type="button" value="Revisi" id="btn-revisi-pq" data-revisi="3 btnrevisi" class="btn" data-toggle="modal" data-target="#history" hidden=true>
					</div>
				</div>
			</div>
			
			<div class="control-group row-fluid" id="div-aanwijz">
				<label class="control-label" for="aanwijz">Aanwijz</label>
				<div class="controls">
					<div class="input-append">
						<input type="text" name="date-aanwijz" id="date-aanwijz">
						<input type="button" value="Revisi" id="btn-revisi-aanwijz" data-revisi="4" class="btn btnrevisi" data-toggle="modal" data-target="#history" hidden=true>
					</div>
				</div>
			</div>
			
			<div class="control-group row-fluid" id="div-pemasukan">
				<label class="control-label" for="pemasukan">Pemasukan File 1</label>
				<div class="controls">
					<div class="input-append">
					<input type="text" name="date-pemasukan" id="date-pemasukan" >
						<input type="button" value="Revisi" id="btn-revisi-pemasukan" data-revisi="1" class="btn btnrevisi" data-toggle="modal" data-target="#history" hidden=true>
					</div>
				</div>
			</div>
			
			<div class="control-group row-fluid" id="div-pemasukan2">
				<label class="control-label" for="pemasukan2">Pemasukan File 2</label>
				<div class="controls">
					<div class="input-append">
						<input type="text" name="date-pemasukan2" id="date-pemasukan2" >
						<input type="button" value="Revisi" id="btn-revisi-pemasukan2" data-revisi="2" class="btn btnrevisi" data-toggle="modal" data-target="#history" hidden=true>
					</div>
				</div>
			</div>
			
			<div class="control-group row-fluid"  id="div-klarifikasi">
				<label class="control-label" for="klarifikasi">Klarifikasi</label>
				<div class="controls">
					<div class="input-append">
						<input type="text" name="date-klarifikasi" id="date-klarifikasi" >
						<input type="button" value="Revisi" id="btn-revisi-klarifikasi" data-revisi="5" class="btn btnrevisi" data-toggle="modal" data-target="#history" hidden=true>
					</div>
				</div>
			</div>
			
			<div class="control-group row-fluid" id="div-kontrak">
				<label class="control-label" for="kontrak">Kontrak</label>
				<div class="controls">
					<input type="text" name="date-kontrak" id="date-kontrak" >
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="remark">Remark</label>
				<div class="controls">
					<input  class="span9" type="text" name="txt-remark" id="txt-remark" >
				</div>
			</div>
			
			<div class="control-group row-fluid">
				<label class="control-label" for="updatestatus">Update Status</label>
				<div class="controls">
					<textarea  class="span9" name="txt-updatestatus" id="txt-updatestatus"></textarea>
				</div>
			</div>
			
		<br clear=ALL>
		<div class="row" id="div-khususpasca">
			<div style="border:1px solid #ddd;background:#eee;">
				<div class="offset1 span5">
					<table style="border:none;width:100%">
											
									<tr><td style="width:50%">
									Pra Brainstorming
									</td><td>
										<input type="text" name="date-prabrain" id="date-prabrain" class="input-block-level" >
									</td></tr><tr><td>
								
									Brainstorming I
									</td><td>
										<input type="text" name="date-brain1" id="date-brain1" class="input-block-level" >
									</td></tr><tr><td>
								
									Brainstorming II
									</td><td>
										<input type="text" name="date-brain2" id="date-brain2" class="input-block-level" >
									</td></tr><tr><td>
								
									Finalisasi
									</td><td>
										<input type="text" name="date-final" id="date-final"  class="input-block-level" >
									</td></tr><tr><td>
								
									Cek Dokumen (final)
									</td><td>
										<input type="text" name="date-cekdok" id="date-cekdok" class="input-block-level" >
									</td></tr>
					</table>
				</div>
				<div class="span5">
					<table style="border:none;width:100%">				
									<tr><td  style="width:50%">
										Anggaran
										</td><td >
												<?php echo form_dropdown("cmb-anggaran",$data_pic,"","id=cmb-anggaran style='width:100%'"); ?>
					</td></tr><tr><td>
									
										Metode
										</td><td>
												<?php echo form_dropdown("cmb-metode",$data_pic,"","id=cmb-metode style='width:100%'"); ?>
					</td></tr><tr><td>
									
										ME
										</td><td>
												<?php echo form_dropdown("cmb-me",$data_pic,"","id=cmb-me style='width:100%'"); ?>
					</td></tr><tr><td>
									
										Harga
										</td><td>
												<?php echo form_dropdown("cmb-harga",$data_pic,"","id=cmb-harga style='width:100%'"); ?>
					</td></tr><tr><td>
									
										Volume
										</td><td>
												<?php echo form_dropdown("cmb-volume",$data_pic,"","id=cmb-volume style='width:100%'"); ?>
					</td></tr><tr><td>
									
										Expert
										</td><td>
												<?php echo form_dropdown("cmb-expert",$data_pic,"","id=cmb-expert style='width:100%'"); ?>
					</td></tr>
									
					</table>
				</div>
				<br clear=ALL>
			</div>

			</div>
		<br clear=ALL>
		<div class="form-actions">
			<button type="button" class="btn btn-primary" id="btn-simpan">Simpan</button>
			<button type="reset" class="btn" id="btn-reset">Reset</button>
		</div>
		<br clear=ALL>
		<p>
		<select id="cmb-tipe-grid">
			<option value="B">Belum Selesai</option>
			<option value="S">Selesai</option>
			<option value="A">Semua</option>
		</select>
		</p>
		<table id="grid-jadwal" class="table table-striped table-bordered" ></table>
		<div id="pgrid-jadwal"></div>
</form>
<form class="form-horizontal" id="form-revisi" disabled=true>
<div class="modal hide fade" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Revisi</h3>
</div>
<div class="modal-body">
		<div class="tab-pane in" id="setup-revisi"><p>
			<input type="text" name="task" value="REVISI" placeholder="0" class="hidden">
			<input type="text" name="revisiid" id="revisiid" placeholder="0" class="hidden">
			<div class="control-group">
				<label class="control-label left" for="revisi">Nilai Kontrak</label>
				<div class="controls">
					<input type="text" id="txt-revisiharga" name="txt-revisiharga" size=3>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label left" for="revisitgl">Tanggal Revisi</label>
				<div class="controls">
					<input type="text" id="date-revisitgl" name="date-revisitgl" size=3>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label left" for="revisiketerangan">Keterangan</label>
				<div class="controls">
					<textarea id="txt-revisiketerangan" name="txt-revisiketerangan"></textarea>
				</div>
			</div>
			
	</p></div>
</div>
<div class="modal-footer">
	<button type="button" class="btn btn-primary" id="btn-simpanrevisi" data-dismiss="modal" >Simpan</button>
	<button type="reset" class="btn" id="btn-resetrevisi" data-dismiss="modal" >Cancel</button>
</div>
</div>
<input type="reset" style="display:none;" id="btn-HiddenResetRevisi">
</form>


<form class="form-horizontal" id="form-history" disabled=true>
<div class="modal hide fade" id="history">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Revisi</h3>
</div>
<div class="modal-body">
		<div class="tab-pane in" id="setup-history"><p>
			<input type="text" name="task" value="HISTORY"  class="hidden">
			<input type="text" name="historyid" id="historyid"   class="hidden">
			<input type="text" name="historyjenis" id="historyjenis"   class="hidden">
			<div class="control-group">
				<label class="control-label left" for="historytgl">Tanggal</label>
				<div class="controls">
					<input type="text" id="date-historytgl" name="date-historytgl" size=3>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label left" for="historyketerangan">Keterangan</label>
				<div class="controls">
					<textarea id="txt-historyketerangan" name="txt-historyketerangan"></textarea>
				</div>
			</div>
			
	</p></div>
</div>
<div class="modal-footer">
	<button type="button" class="btn btn-primary" id="btn-simpanhistory" data-dismiss="modal" >Simpan</button>
	<button type="reset" class="btn" id="btn-resethistory" data-dismiss="modal" >Cancel</button>
</div>
</div>
<input type="reset" style="display:none;" id="btn-HiddenResethistory">
</form>